We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.

Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)

Bug 3392733 - git nasm: %assign ?%1 is broken: error: `%assign' expects a macro identifier
Summary: git nasm: %assign ?%1 is broken: error: `%assign' expects a macro identifier
Status: CLOSED FIXED
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 2.16.xx
Hardware: All All
: Medium blocker
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2020-12-27 16:44 PST by E. C. Masloch
Modified: 2021-03-24 13:46 PDT (History)
5 users (show)

Obtained from: Built from git using configure
Generated by: ---
Bug category:
Observed for: ---
Regression: ---
Regression since:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E. C. Masloch 2020-12-27 16:44:04 PST
The nasm binary is as built from nasm-2.15.05-113-gdc4a6194. This bug disables all usages of my stack frame calculation macros because they preserve and set up defines using the ?%1 naming scheme. The lmacros2.mac file used by the longer example is available at https://hg.ulukai.org/ecm/lmacros

I have not yet found a workaround for this bug. Downgrading the nasm I'll use for now.

$ nasm -v
NASM version 2.16rc0 compiled on Dec 28 2020
$ cat test1.asm
%include "lmacros2.mac"

        lframe none
        lenter
        lvar word, definename
        lleave
$ nasm test1.asm -I ../lmacros/
test1.asm:4: error: `%ifdef' expects macro identifiers
test1.asm:4: error: `%assign' expects a macro identifier
test1.asm:5: error: `%ifdef' expects macro identifiers
test1.asm:5: error: `%assign' expects a macro identifier
$ cat test2.asm
        %macro mac 1
%assign ?%1 1
        %endmacro

mac definename
$ nasm test2.asm
test2.asm:5: error: `%assign' expects a macro identifier
test2.asm:2: ... from macro `mac' defined here
$ oldnasm -v
NASM version 2.14.03rc2 compiled on Aug 31 2019
$ oldnasm test1.asm -I ../lmacros/
$ oldnasm test2.asm
Comment 1 H. Peter Anvin 2021-03-24 10:53:35 PDT
Fix checked in as git ID 5368e4579403daaf6c12165eb857893f8acfc7f8
(nasm-2.15.05-118-g5368e457).
Comment 2 E. C. Masloch 2021-03-24 13:46:17 PDT
I just rebuilt with this commit applied plus the preprocessor shift left fix in https://bugzilla.nasm.us/show_bug.cgi?id=3392747#c5 and also utilising the workaround in https://bugzilla.nasm.us/show_bug.cgi?id=3392732#c1

This commit does appear to fix my usecase.